<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>物业服务</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="//cdn.bootcss.com/weui/0.4.3/style/weui.min.css">
		<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/0.8.3/css/jquery-weui.min.css">
		<link rel="stylesheet" href="../css/index.css" />
		<style>
			#readnum{
				width: 18px;
				height: 18px;
				background-color: #FD482C;
				border-radius: 18px;
				line-height: 18px;
				color: #FFFFFF;
				font-size: 12px;
				display: block;
				position: absolute;
				top: 3px;
				right: 35px;
				display: none;
			}
		</style>
	</head>
	<body id="property">
		<header>
			<div id="swiper-container1" class="swiper-container"  >
				<div class="swiper-wrapper" id="carousellist">
					<!--<div class="swiper-slide"><img src="../img/lunbo.png" /></div>
					<div class="swiper-slide"><img src="../img/lunbo.png" /></div>
					<div class="swiper-slide"><img src="../img/lunbo.png" /></div>
					<div class="swiper-slide"><img src="../img/lunbo.png" /></div>-->
				</div>
				<div class="swiper-pagination"></div>
			</div>
		</header>
		<div class="top_xx">
			<section>
				<b>万象资讯</b>
					<div id="swiper-container2" class="swiper-container">
						<div class="swiper-wrapper in_list" id="newslist">
				        	<!--<div class="swiper-slide"><p>万象物业上线啦！</p></div>
				        	<div class="swiper-slide"><p>全场八折！</p></div>	
				        	<div class="swiper-slide"><p>走过路过不要错过</p></div>-->
						</div>
					</div>
				<a href="fournewslist.html?type=1">
				<strong>
					|&nbsp;&nbsp;更多
				</strong>
				</a>
			</section>
		</div>
		<div class="main">
			<div class="weui-row  weui-no-gutter">
			  <div class="weui-col-50" style="border-bottom: 1px solid #E8E8E8 !important;border-right: 1px solid #E8E8E8 !important;">
			  	<a href="newsList.html"> 
			  	<img src="../img/zsxx.png" />
			  	<p style="position: relative;">专属消息<span id="readnum"></span></p>
			  	</a>
			  </div>
			 
			  <div class="weui-col-50" style="border-bottom: 1px solid #E8E8E8 !important;">
			  	<a href="bxbs.html?type=1">
			  	<img src="../img/bx.png" />
			  	<p>报修报事</p>
			  	</a>
			  </div>
			  <div class="weui-col-50" style="border-right: 1px solid #E8E8E8 !important;">
			  	<a href="bxbs.html?type=2">
			  	<img src="../img/tsby.png" />
			  	<p>投诉表扬</p>
			  	</a>
			  </div>
			  <div class="weui-col-50">
			  	<a href="bxbs.html?type=3">
			  	<img src="../img/zxjy.png" />
			  	<p>咨询建议</p>
			  	</a>
			  </div>
			</div>
		</div>
		<script type="text/javascript" src="../js/jquery-1.8.2.min.js" ></script>
		<script src="//cdn.bootcss.com/jquery-weui/0.8.3/js/jquery-weui.min.js"></script>
		<script type="text/javascript" src="../js/swiper-3.4.2.jquery.min.js"></script>
		<script type="text/javascript" src="../js/basic.js"></script>
		<script>
			function lunbo1() {
				var mySwiper = new Swiper('#swiper-container1', {
					autoplay: 3000,
					pagination: '.swiper-pagination',
					paginationClickable: true,
				});
			}
			function lunbo2() {
				var mySwiper = new Swiper('#swiper-container2', {
			        paginationClickable: true,
			        direction: 'vertical',
			        autoplay : 3000,
			        loop: true
				});
			}
			var ip_addr = getUrl();
			$(document).ready(function() {
				indexCarousellist();
				fnewslist();
				
				var userMsg = localStorage.getItem("userMsg")
				if(!userMsg){
				}else{
				$("#readnum").show();
					$.ajax({
						type: 'post',
						dataType: "json",
						url: ip_addr + 'message/readNum',
						success: function(data) {
							if(data.code == 0) {
								$("#readnum").text(data.total);
								if(data.total == 0){
									$("#readnum").hide()
								}
							} else {
								$("#readnum").hide()
							}
						}
					});
				}
				
			});
			//物业服务轮播图接口
			function indexCarousellist() {
				$.ajax({
					type: 'post',
					dataType: "json",
					url: ip_addr + 'indexCarousel/list',
					data: {
						type: 1
					},
					success: function(data) {
						var result = data.rows;
						var innerHTML = '';
						if(data.code == 0) {
							for(var i = 0; i < result.length; i++) {
								innerHTML +='<div class="swiper-slide">';
								
								if(result[i].relation == 1){
								innerHTML +='<a href="presslistdetails.html?id='+result[i].jumpId+'">';
								}else{
									innerHTML +='<a href="javascript:;">';
								}
								
								innerHTML +='<img src="'+result[i].img.replace('../',"")+'" />';
								
								innerHTML +='</a>';
								innerHTML +='</div>';
								
							}
							$("#carousellist").append(innerHTML);
							lunbo1();
						} else {
							alert(data.msg);
						}
					}
				});
			}
			//首页新闻滚动前5条
			function fnewslist() {
				$.ajax({
					type: 'post',
					dataType: "json",
					url: ip_addr + 'news/indexList',
					data: {
						type: 1
					},
					success: function(data) {
						var result = data.rows;
						var innerHTML = '';
						if(data.code == 0) {
							for(var i = 0; i < result.length; i++) {
								innerHTML +='<div class="swiper-slide" style="overflow: hidden;">';
								innerHTML +='<a href="presslistdetails.html?id='+result[i].id+'">';
								innerHTML +='<p>'+result[i].title+'</p>';
								innerHTML +='</a>';
								innerHTML +='</div>';
							}
							$("#newslist").append(innerHTML);
							lunbo2();
						} else {
							
						}
					}
				});
			}
			
			
			
		</script>
	</body>
</html>
